luci-mod-network: Add flag for address_as_local
authorMarko Zajc <[email protected]>
Wed, 24 Sep 2025 15:44:35 +0000 (17:44 +0200)
committerPaul Donald <[email protected]>
Tue, 18 Nov 2025 15:34:39 +0000 (16:34 +0100)
'Addresses' option entries in the general tab of DHCP and DNS settings are
sometimes (I'm not sure about the exact conditions) passed to upstream resolver,
bypassing local resolution.

A workaround for a small list of domains is to add them to 'Resolve these
locally' option, but this is very tedious to do, and dnsmasq limits it to 1024
characters.

openwrt/openwrt#18610 adds behaviour to add addresses to the local resolution
list automatically, and this commit adds a flag to LuCI to control that.

Signed-off-by: Marko Zajc <[email protected]>
modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js

index b886c38e2a86a0fb1add3704879802df58d4348d..416b50ff9ae95029c068e9fb04522b80627c90c0 100644 (file)
@@ -364,6 +364,11 @@ return view.extend({
                o.optional = true;
                o.datatype = 'uinteger';
                o.placeholder = 150;
+
+               o = s.taboption('general', form.Flag, 'address_as_local',
+                       _('Resolve addresses locally'),
+                       _('Never send queries for FQDNs in the Address option to an upstream resolver.'));
+               o.optional = true;
                // End general
 
                // Begin devices